/* eslint-disable */
// 该文件由 OneAPI 自动生成，请勿手动修改！
import {apiPrefixDispose} from '@/utils/format';
import {request} from '@umijs/max';


/**
 * 添加定时任务
 */
export async function addRecurring<T = any>(params:API.AddRecurring) {
  // console.log('addRecurring', params);
  return request<API.ResultVO<string>>(apiPrefixDispose('/quartz/addRecurring'), {
    method: 'GET',
    params: { ...params }
  });
}

/**
 * 添加延时任务
 */
export async function addDelay<T = any>(params:API.AddDelay) {
  // console.log('addDelay', params);
  return request<API.ResultVO<string>>(apiPrefixDispose('/quartz/addDelay'), {
    method: 'GET',
    params: { ...params }
  });
}


/**
 * 查询任务
 */
export async function pageJob<T = any>(body: API.Pagings) {
  return request<API.ResultPageVO<API.JobAndTriggerBO>>(apiPrefixDispose('/quartz/page'), {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
  });
}


/**
 * 删除任务
 * @param jName 任务名
 */
export async function quartzDelete<T = any>(jName: string) {
  return request<API.ResultVO<string>>(apiPrefixDispose('/quartz/delete'), {
    method: 'GET',
    params: { 'jName':jName }
  });
}


/**
 * 暂停任务
 * @param jName 任务名
 */
export async function quartzPause<T = any>(jName: string) {
  return request<API.ResultVO<string>>(apiPrefixDispose('/quartz/pause'), {
    method: 'GET',
    params: { 'jName':jName }
  });
}



/**
 * 重启任务
 * @param jName 任务名
 */
export async function quartzResume<T = any>(jName: string) {
  return request<API.ResultVO<string>>(apiPrefixDispose('/quartz/resume'), {
    method: 'GET',
    params: { 'jName':jName }
  });
}



/**
 * 重置任务
 */
export async function quartzRes<T = any>(params:API.Res) {
  return request<API.ResultVO<string>>(apiPrefixDispose('/quartz/res'), {
    method: 'GET',
    params: { ...params }
  });
}


/**
 * 手动执行一次[存在的任务]
 * @param jName 任务名
 */
export async function quartzRun<T = any>(jName: string) {
    return request<API.ResultVO<string>>(apiPrefixDispose('/quartz/run'), {
      method: 'GET',
      params: { 'jName':jName }
    });
  }
